<%@ page pageEncoding="utf-8"%> 

<!DOCTYPE html>
<html lang="en" dir="ltl">
<head>
<meta charset="utf-8" />
<title>${page_title}</title>

<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+
		(request.getServerPort() == 80 ? "" : (":"+request.getServerPort())) +path+"/";  
	String   userName   =   (String)session.getAttribute("userName");
	String   userType   =   (String)session.getAttribute("userType");
	String 	 menus=(String)session.getAttribute("menus");
 	if(userName==null){
 		//String newLocn = basePath+"login.jsp";
 		//request.getRequestDispatcher(newLocn).forward(request,response);
 		//return;
 	}
%>

<script type="text/javascript">
	var base_path = "<%=basePath%>";
	var user_name="<%=userName%>";
	var user_type="<%=userType%>";
	var menus="<%=menus%>";
</script>

<base href="<%=basePath%>">
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/text.css" />
<link rel="stylesheet" href="css/960.css" />
<link rel="stylesheet" href="css/demo.css" />
<link rel="stylesheet" href="css/style.css" />
<script type='text/javascript' src='js/jquery-1.5.2.min.js'></script>
<script type='text/javascript'>
	$(document).ready(function() {
		if(user_name=="null"){
			window.location.href=base_path+"login.jsp";
		}
		$("#center").css(
			    "min-height", function(index, value) {return $(window).height()-$("#top").height()-$("#menubar").height()-$("#bottom").height();}
			  );
	});
	function logout(){
		   $.ajax({
				url: base_path+"Login/logout.do",
	            data: "{}", 
				
				success: function(data, textStatus){
					
				},
				complete: function(XMLHttpRequest, textStatus){
					window.location.href=base_path+"login.jsp";

				},
				error: function(){
				}
			});
	   }
	 function getDate(){     
		 var date=new Date();     
		 var month=date.getMonth()+1;     
		 var day=date.getDate();     
		     
		 if(month.toString().length == 1){  //或者用if (eval(month) <10) {month="0"+month}     
		     
		 month='0'+month;     
		 }     
		 if(day.toString().length == 1){     
		 day='0'+day;     
		 }     
		 return date.getFullYear()+'年'+month+'月'+day+''+date.toLocaleString().substring(date.toLocaleString().length- 10)+'  '+'星期'+'日一二三四五六'.charAt(date.getDay());      
	 }     
</script>
 
</head>
<body style="padding-bottom:0;margin-bottom:0;">
<div class="container_12" id="container" style="padding-bottom:0;margin-bottom:0;">
  	<div class="grid_6" id="top" style="height:60px;">
  			<br><img alt="数字化校园" src="images/preloader.png"/>
  	</div>
  	<div class="grid_6" style="vertical-align:middle;height:60px;">
  		<table style="margin-top:10px;width:100%;font-size:13px;">
  			<tr style="height:25px;margin:0;padding:0;"  valign=middle>
  				<td width=70 align=right style="font-weight:bold;border:0;">当前用户：</td>
  				<td  width=70 align=left style="font-weight:bold;border:0;"><%=userName%></td>
  				<td align=right style="font-size:14px;text-align:center;font-style:italic;border:0;">
  					欢迎登录使用选课系统
  				</td>
  				
  			</tr>
  			<tr style="height:25px;margin:0;padding:0;"  valign=middle>
  				<td align=left style="font-weight:bold;border:0;">用户角色：</td>
  				<td align=right style="font-weight:bold;border:0;"><%=userType%></td>
  				<td align=right style="vertical-align:bottom;font-size:12px;text-align:right;border:0;">
  					当前系统时间：<span id="time">     
			 <script>     
			 document.getElementById('time').innerHTML=getDate();     
			 setInterval("document.getElementById('time').innerHTML=getDate();",1000);     
			 </script>      
			</span>  
  				</td>
  			</tr>
  			
  		</table>
  				
  	</div>
  	<div class="clear"></div>
  	
  	<div class="grid_12"  style="height:50px;" id="menubar">
	  	<div class="menucontainer">
			<div class="menu">
				<ul id="menus">
					<%=menus%>
				</ul>
			</div>
		</div>
  	</div>
  <div class="clear"></div>
  <div class="grid_12" id="center" style="border:1px solid gray;text-align:center;">
  		
<%@page import="com.course.db.*"%>

<%
	request.setAttribute("layout","main.jsp");
	request.setAttribute("page_title","温岭选课系统-课程列表");
	String courseId = (String)request.getAttribute("courseId");
%>
<style>

</style>
<% 
	CourseBasic course = (CourseBasic)request.getAttribute("Course");
	System.out.println(course.toString());
%>

<div style="width:100%; text-align:center;">
 	<p style="border:0;font-size:14px;padding-bottom:0;">
 		 <b>课程《<%=course.getName() %>》 详情</b>
	</p>
  	<table width="90%"  style="border:1px solid gray;margin-left:5%;" >
      <tbody>
              <tr>
 				<td>教师姓名</td>
 				<td class="tdLeft"><%=course.getTeachers() %></td>
 			</tr>
 			<tr>
 				<td>课程分类</td>
 				<td class="tdLeft"><%=course.getType() %></td>
 			</tr>
 			<tr>
 				<td>课程名称</td>
 				<td class="tdLeft"><%=course.getName() %></td>
 			</tr>
 			<tr>
 				<td>总学时数</td>
 				<td class="tdLeft"><%=course.getCourse_span() %></td>
 			</tr>
 			<tr>
 				<td>课程学分</td>
 				<td class="tdLeft"><%=course.getCredit() %></td>
 			</tr>
 			<tr>
 				<td>限制人数</td>
 				<td class="tdLeft"><%=course.getStudents_low() %>/<%=course.getStudents_high() %>(最多/最少)</td>
 			</tr>
 			<tr>
 				<td>上课时间|地点</td>
 				<td class="tdLeft"><%=course.getTeach_time() %>|<%=course.getTeach_location() %></td>
 			</tr>
 			<tr>
 				<td>教学方式</td>
 				<td class="tdLeft"><%=course.getTeach_style() %></td>
 			</tr>
 			<tr>
 				<td>考核方式</td>
 				<td class="tdLeft"><%=course.getTest_style() %></td>
 			</tr>
 			<tr>
 				<td>课程内容</td>
 				<td class="tdLeft"><%=course.getIntroduction() %></td>
 			</tr>
 			<tr>
 				<td>教学所属设备</td>
 				<td class="tdLeft"><%=course.getTeach_equipments() %></td>
 			</tr>
            <tr>
                <td align="center" width="94">其他信息：</td>
                <td width="516">&nbsp;该课程最多可以容纳<font color="#ff0000"><%=course.getStudents_high() %></font>人，<!--最少需要<FONT 
                  color=#ff0000><%=course.getStudents_low() %></FONT>人才可以开班，-->目前已经有<font color="#ff0000"><%=course.getNum_of_students() %></font>人选择该课程。</td>
            </tr>
            <tr>
                <td align="center" width="94">学生名单：</td>
                <td width="516" style="MARGIN-LEFT: 2px; TEXT-INDENT: 2px; LINE-HEIGHT: 150%; MARGIN-RIGHT: 2px"></td>
            </tr>
         </tbody>
     </table>
</div>
  </div>
  <div class="clear"></div>
  <div class="grid_12"  style="height:50px;" id="bottom">
	  <p style="border:0;font-size:13px;">
		   浙江省温岭中学  CopyRight：2011-2012           杭州池墨科技有限公司
	  </p> 	  	
  </div>
 
</div>
</body>
</html>